#ifndef B2D_GLTEXTURE_H
#define B2D_GLTEXTURE_H

#include "Texture.h"
#include "ResourceFactory.h"
#include "GL/OpenGL.h"

NS_B2D_BEGIN


///
/// OpenGL implementation of a texture
///
class B2D_API GLTexture final
	: public Texture
{
	B2D_OBJECT

private:
	GLuint mTextureHandle;

public:
	GLTexture(void);
	~GLTexture(void);

	GLuint getGLName(void) const { return mTextureHandle; }
	bool isInitialised(void) const { return mTextureHandle != 0; }

private:
	void initialiseWithDataImpl(const void* data);
	//void updateSamplerStateImpl(void);
};

typedef DefaultResourceFactory<ITexture,GLTexture> GLTextureFactory;

NS_B2D_END

#endif